package com.stm.bi.enums;

/**
 * @author zhouyuanpeng
 **/
public enum ProductStructIndex {

    RETURN_RATE("return_rate", "退货率"),
    DIGESTIBILITY("digestibility", "售罄率"),
    SALES_AMOUNT("sale_amount", "销售额"),
    RETURN_AMOUNT("return_amount", "退货量");
    /**
     * 字段类型值
     */
    private final String value;
    /**
     * 字段类型描述
     */
    private final String desc;

    ProductStructIndex(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static ProductStructIndex getFieldType(String value) {
        for (ProductStructIndex ut : ProductStructIndex.values()) {
            if (ut.getValue().equals(value)) {
                return ut;
            }
        }
        return null;
    }

    public String getValue() {
        return this.value;
    }

    public String getDesc() {
        return desc;
    }
}
